﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Diagnostics;

namespace KingOfCSharp.iHunter.UI
{
    public partial class FirstRunWizard : Form
    {
        private int pageIndex = 0;

        public string UserName { get; private set; }

        public string AttachmentFolder { get; private set; }

        public FirstRunWizard()
        {
            InitializeComponent();
        }

        private void buttonNext_Click(object sender, EventArgs e)
        {
            if (pageIndex == 0)
            {
                pageIndex = 1;
                this.firstRunSettingsPanel1.Visible = true;
                this.buttonBack.Enabled = true;
                this.buttonNext.Text = "&Finish";
            }
            else if (pageIndex == 1)
            {
                if (this.firstRunSettingsPanel1.textBoxUserName.Text == string.Empty)
                {
                    MessageBox.Show("Please enter your name.", "Error!",
                        MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

  
                this.UserName = firstRunSettingsPanel1.textBoxUserName.Text;
                this.AttachmentFolder = firstRunSettingsPanel1.textBoxAttFolder.Text;

                this.DialogResult = DialogResult.OK;
            }
        }

        private void buttonBack_Click(object sender, EventArgs e)
        {
            if (pageIndex == 1)
            {
                pageIndex = 0;
                this.firstRunSettingsPanel1.Visible = false;
                this.buttonBack.Enabled = false;
                this.buttonNext.Text = "&Next";
            }
            else
            {
                Debug.Assert(false);
            }
        }
    }
}
